import { useEffect } from "react"
import { HashRouter, Route, Routes } from "react-router-dom"
import routes from "../../route/router"
// import { logOutHandle } from "../../service/account"
// import cookieStore from "../../store/cookie"

export default function App() {
  useEffect(() => {
    return () => {
      // logOutHandle(cookieStore.getState().toString())
    }
  }, [])

  return (
    <HashRouter>
      <Routes>
        {routes.map((r, index) =>
        (<Route
          key={r.path + index}
          path={r.path}
          element={r.component()}
        />)
        )}
      </Routes>
    </HashRouter>
  )
}